HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //var/www/html/orbi-individual/node_modules/next/dist/esm/lib/helpers/get-pkg-manager.js
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
export function getPkgManager(baseDir) {
    try {
        for (const { lockFile, packageManager } of [
            {
                lockFile: "yarn.lock",
                packageManager: "yarn"
            },
            {
                lockFile: "pnpm-lock.yaml",
                packageManager: "pnpm"
            },
            {
                lockFile: "package-lock.json",
                packageManager: "npm"
            }
        ]){
            if (fs.existsSync(path.join(baseDir, lockFile))) {
                return packageManager;
            }
        }
        const userAgent = process.env.npm_config_user_agent;
        if (userAgent) {
            if (userAgent.startsWith("yarn")) {
                return "yarn";
            } else if (userAgent.startsWith("pnpm")) {
                return "pnpm";
            }
        }
        try {
            execSync("yarn --version", {
                stdio: "ignore"
            });
            return "yarn";
        } catch  {
            execSync("pnpm --version", {
                stdio: "ignore"
            });
            return "pnpm";
        }
    } catch  {
        return "npm";
    }
}

//# sourceMappingURL=get-pkg-manager.js.map